package com.components.project.ui.activity

import android.os.Bundle
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import com.blankj.utilcode.util.ToastUtils
import com.components.base.titlebar.OnTitleBarListener
import com.components.base.titlebar.TitleBar
import com.components.project.R
import com.gyf.immersionbar.ImmersionBar

class TitleBarActivity :AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_title_bar)
        ImmersionBar.with(this).init()
        findViewById<TitleBar>(R.id.titleBar).setOnTitleBarListener(object :OnTitleBarListener{
            override fun onLeftClick(view:View) {
                ToastUtils.showShort("左击")
            }

            override fun onTitleClick(view:View) {
                ToastUtils.showShort("中击")
            }

            override fun onRightClick(view:View) {
                ToastUtils.showShort("右击")
            }
        })
    }

}